<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>StarFall</title>
    <link rel="stylesheet" href="./css/editHome.css">
    <link rel="shortcut icon" href="img/starfall.png" type="image/x-icon">
</head>
<script src="./js/page.js"></script>
<body onload="start()">
    <div class="tips" th:if="${session.administerTips} != null">
        <div class="tipsDiv">
            <p>提示:</p>
            <span th:text="${session.administerTips}">...</span>
            <button class="btn tipsBtn" onclick="hideTips()">确认</button>
        </div>
    </div>
<input class="pageHide" type="hidden" th:value="${session.administerPage}">
<div class="labelBar">
    <ul>
        <li><div style="border: 0;border-bottom:5px solid #313131 ; padding: 20px 0;">管理面板</div></li>
        <li><a href="javascript:pageTransform(1);setPage(1)">主页</a></li>
        <li><a href="javascript:pageTransform(2);setPage(2)">用户</a></li>
        <li><a href="javascript:pageTransform(3);setPage(3)">主题</a></li>
        <li><a href="javascript:pageTransform(4);setPage(4)">公告</a></li>
        <li><a href="javascript:pageTransform(5);setPage(5)">评论</a></li>
        <li><a href="javascript:pageTransform(6);setPage(6)">喜欢</a></li>
        <li><a href="/home">返回</a></li>
    </ul>
</div>
<div class="square"></div>
<div class="page">
    <div class="homePage">
        <div class="welcome">
            <p>你好，管理员!</p>
        </div>
        <div class="sum">
            <p style="position: relative;left: 10px;font-weight: bold;font-size: 25px;">统计:</p>
            <div class="online">当前在线人数:&nbsp;<span class="onlineCount">0</span></div>
        </div>
    </div>
    <div class="userPage">
        <div>
            <button class="btn addBtn" onclick="href('/administer/addData?type=user')">添加</button>
            <table>
                <tr class="EditTh">
                    <th><div><span>用户名<br>User</span></div></th>
                    <th><div><span>密码<br>Password</span></div></th>
                    <th><div><span>注册日期<br>Date</span></div></th>
                    <th><div style="width: 50px;"><span>等级<br>Level</span></div></th>
                    <th><div><span>名称<br>Name</span></div></th>
                    <th><div style="width: 200px;"><span>介绍<br>Introduce</span></div></th>
                    <th><div style="width: 200px;"><span>邮箱<br>Email</span></div></th>
                    <th><div style="width: 120px;"><span>经验<br>Exp</span></div></th>
                    <th><div><span>头像<br>Head</span></div></th>
                    <th><div style="width: 120px;"><span>操作<br>Operate</span></div></th>
                </tr>
                <tr class="EditTd" th:each="user : ${session.adminUsers}">
                    <td><div th:text="${user.user}" style="width: 150px;">user</div></td>
                    <td><div th:text="${user.password}" style="width: 150px;">password</div></td>
                    <td><div th:text="${user.date}">0000-00-00</div></td>
                    <td><div th:text="${user.level}" style="width: 50px;">level</div></td>
                    <td><div th:text="${user.name}">name</div></td>
                    <td><div th:text="${user.introduce}" style="width: 200px;">introduce</div></td>
                    <td><div th:text="${user.email}" style="width: 200px;">12345678901@163.com</div></td>
                    <td><div th:text="${user.exp}">111</div></td>
                    <td style="text-align: center;">
                        <img class="minImg" th:src="'../head_img/'+${user.head}" alt="">
                    </td>
                    <td style="text-align: center;">
                        <button class="btn" th:onclick="href('/administer/modify?user='+[[${user.user}]])">编辑</button>
                        &nbsp;
                        <button class="btn" th:onclick="href('/administer/delete?user='+[[${user.user}]])">删除</button>
                    </td>
                </tr>
            </table>
            <div class="changePage">
                <button class="btn" th:onclick="|Page(1,${session.adminPageUsers.getLastPage()},1)|">首页</button>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageUsers.getPage()}-1,${session.adminPageUsers.getLastPage()},1)|">←</button>
                <span th:text="${session.adminPageUsers.getPage()}+'/'+${session.adminPageUsers.getLastPage()}">1/1</span>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageUsers.getPage()}+1,${session.adminPageUsers.getLastPage()},1)|">→</button>
                <button class="btn" th:onclick="|Page(${session.adminPageUsers.getLastPage()},${session.adminPageUsers.getLastPage()},1)|">尾页</button>
            </div>
        </div>
    </div>
    <div class="topicPage">
        <div>
            <button class="btn addBtn" onclick="href('/administer/addData?type=topic')">添加</button>
            <table>
                <tr class="EditTh">
                    <th><div style="width: 50px"><span>编号<br>Id</span></div></th>
                    <th><div><span>发帖用户<br>PublishUser</span></div></th>
                    <th><div style="width: 80px;"><span>图标<br>Icon</span></div></th>
                    <th><div style="width: 80px;"><span>标签<br>Label</span></div></th>
                    <th><div style="width: 300px;"><span>大标题<br>BigTitle</span></div></th>
                    <th><div><span>作者<br>Author</span></div></th>
                    <th><div><span>发布日期<br>Date</span></div></th>
                    <th><div style="width: 50px"><span>评论<br>Num</span></div></th>
                    <th><div style="width: 50px"><span>浏览<br>Num</span></div></th>
                    <th><div style="width: 80px"><span>来源<br>Source</span></div></th>
                    <th><div style="width: 50px"><span>版本<br>Version</span></div></th>
                    <th><div><span>语言<br>Language</span></div></th>
                    <th><div style="width: 120px"><span>操作<br>Operate</span></div></th>
                </tr>
                <tr class="EditTd" th:each="topic : ${session.adminTopics}">
                    <td><div th:text="${topic.id}">id</div></td>
                    <td><div th:text="${topic.user}">user</div></td>
                    <td style="text-align: center;"><img th:src="'../img/topic/icon/'+${topic.icon}" alt="" class="minImg"></td>
                    <td><div th:text="${topic.label}">label</div></td>
                    <td><div th:text="${topic.title}" style="width:300px">title</div></td>
                    <td><div th:text="${topic.authorname}">author</div></td>
                    <td><div th:text="${topic.date}">date</div></td>
                    <td><div th:text="${topic.comment}">0</div></td>
                    <td><div th:text="${topic.view}">0</div></td>
                    <td><div th:text="${topic.source}">原创</div></td>
                    <td><div th:text="${topic.version}" style="width: 50px;">0.00.0</div></td>
                    <td><div th:text="${topic.language}" style="width: 100px;">简体中文</div></td>
                    <td style="text-align: center;">
                        <button class="btn" th:onclick="href('/administer/modify?topic='+[[${topic.id}]])">编辑</button>
                        &nbsp;
                        <button class="btn" th:onclick="href('/administer/delete?topic='+[[${topic.id}]])">删除</button>
                    </td>
                </tr>
            </table>
            <div class="changePage">
                <button class="btn" th:onclick="|Page(1,${session.adminPageTopics.getLastPage()},2)|">首页</button>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageTopics.getPage()}-1,${session.adminPageTopics.getLastPage()},2)|">←</button>
                <span th:text="${session.adminPageTopics.getPage()}+'/'+${session.adminPageTopics.getLastPage()}">1/1</span>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageTopics.getPage()}+1,${session.adminPageTopics.getLastPage()},2)|">→</button>
                <button class="btn" th:onclick="|Page(${session.adminPageTopics.getLastPage()},${session.adminPageTopics.getLastPage()},2)|">尾页</button>
            </div>
        </div>
    </div>
    <div class="noticePage">
        <div>
            <button class="btn addBtn" onclick="href('/administer/addData?type=notice')">添加</button>
            <table>
                <tr class="EditTh">
                    <th><div><span>公告编号<br>Id</span></div></th>
                    <th><div style="width: 1000px;"><span>内容<br>Content</span></div></th>
                    <th><div style="width: 120px;"><span>操作<br>Operate</span></div></th>
                </tr>
                <tr class="EditTd" th:each="notice : ${session.adminNotices}">
                    <td><div th:text="${notice.id}">id</div></td>
                    <td><div th:text="${notice.content}" style="width: 1000px;">content</div></td>
                    <td style="text-align: center;">
                        <button class="btn" th:onclick="href('/administer/modify?notice='+[[${notice.id}]])">编辑</button>
                        &nbsp;
                        <button class="btn" th:onclick="href('/administer/delete?notice='+[[${notice.id}]])">删除</button>
                    </td>
                </tr>
            </table>
            <div class="changePage">
                <button class="btn" th:onclick="|Page(1,${session.adminPageNotices.getLastPage()},3)|">首页</button>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageNotices.getPage()}-1,${session.adminPageNotices.getLastPage()},3)|">←</button>
                <span th:text="${session.adminPageNotices.getPage()}+'/'+${session.adminPageNotices.getLastPage()}">1/1</span>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageNotices.getPage()}+1,${session.adminPageNotices.getLastPage()},3)|">→</button>
                <button class="btn" th:onclick="|Page(${session.adminPageNotices.getLastPage()},${session.adminPageNotices.getLastPage()},3)|">尾页</button>
            </div>
        </div>
    </div>
    <div class="commentPage">
        <div>
            <button class="btn addBtn" onclick="href('/administer/addData?type=Comment')">添加</button>
            <table>
                <tr class="EditTh">
                    <th><div><span>编号<br>Id</span></div></th>
                    <th><div><span>主题<br>Topic</span></div></th>
                    <th><div><span>用户<br>User</span></div></th>
                    <th><div style="width: 800px;"><span>内容<br>Content</span></div></th>
                    <th><div style="width: 120px;"><span>操作<br>Operate</span></div></th>
                </tr>
                <tr class="EditTd" th:each="comment : ${session.adminComments}">
                    <td><div th:text="${comment.id}">id</div></td>
                    <td><div th:text="${comment.topicid}">topic</div></td>
                    <td><div th:text="${comment.user}">user</div></td>
                    <td><div th:text="${comment.content}">content</div></td>
                    <td style="text-align: center;">
                        <button class="btn" th:onclick="href('/administer/modify?comment='+[[${comment.id}]])">编辑</button>
                        &nbsp;
                        <button class="btn" th:onclick="href('/administer/delete?comment='+[[${comment.id}]])">删除</button>
                    </td>
                </tr>
            </table>
            <div class="changePage">
                <button class="btn" th:onclick="|Page(1,${session.adminPageComments.getLastPage()},4)|">首页</button>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageComments.getPage()}-1,${session.adminPageUsers.getLastPage()},4)|">←</button>
                <span th:text="${session.adminPageComments.getPage()}+'/'+${session.adminPageComments.getLastPage()}">1/1</span>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageComments.getPage()}+1,${session.adminPageComments.getLastPage()},4)|">→</button>
                <button class="btn" th:onclick="|Page(${session.adminPageComments.getLastPage()},${session.adminPageComments.getLastPage()},4)|">尾页</button>
            </div>
        </div>
    </div>
    <div class="likePage">
        <div>
            <button class="btn addBtn" onclick="href('/administer/addData?type=good')">添加</button>
            <table>
                <tr class="EditTh">
                    <th><div><span>编号<br>Id</span></div></th>
                    <th><div><span>主题<br>Topic</span></div></th>
                    <th><div><span>用户<br>User</span></div></th>
                    <th><div><span>喜欢<br>Like</span></div></th>
                    <th><div style="width: 120px;"><span>操作<br>Operate</span></div></th>
                </tr>
                <tr class="EditTd" th:each="good : ${session.adminGoods}">
                    <td><div th:text="${good.id}">id</div></td>
                    <td><div th:text="${good.topicid}">topic</div></td>
                    <td><div th:text="${good.user}">user</div></td>
                    <td><div th:text="${good.good}">like</div></td>
                    <td style="text-align: center;">
                        <button class="btn" th:onclick="href('/administer/modify?good='+[[${good.id}]])">编辑</button>
                        &nbsp;
                        <button class="btn" th:onclick="href('/administer/delete?good='+[[${good.id}]])">删除</button>
                    </td>
                </tr>
            </table>
            <div class="changePage">
                <button class="btn" th:onclick="|Page(1,${session.adminPageGoods.getLastPage()},5)|">首页</button>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageGoods.getPage()}-1,${session.adminPageGoods.getLastPage()},5)|">←</button>
                <span th:text="${session.adminPageGoods.getPage()}+'/'+${session.adminPageGoods.getLastPage()}">1/1</span>
                <button class="btn arrow" th:onclick="|Page(${session.adminPageGoods.getPage()}+1,${session.adminPageGoods.getLastPage()},5)|">→</button>
                <button class="btn" th:onclick="|Page(${session.adminPageGoods.getLastPage()},${session.adminPageGoods.getLastPage()},5)|">尾页</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>